Inversion of control in c